//package cn.cttic.app.api.controller;
//
//import cn.dev33.satoken.annotation.SaCheckPermission;
//import cn.cttic.app.api.domain.bo.AppUserBo;
//import cn.cttic.app.api.domain.vo.AppUserVo;
//import cn.cttic.app.service.IAppUserService;
//import cn.cttic.common.core.domain.R;
//import cn.cttic.common.core.validate.AddGroup;
//import cn.cttic.common.core.validate.EditGroup;
//import cn.cttic.common.core.web.controller.BaseController;
//import cn.cttic.common.excel.utils.ExcelUtil;
//import cn.cttic.common.log.annotation.Log;
//import cn.cttic.common.log.enums.BusinessType;
//import cn.cttic.common.mybatis.core.page.PageQuery;
//import cn.cttic.common.mybatis.core.page.TableDataInfo;
//import lombok.RequiredArgsConstructor;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletResponse;
//import jakarta.validation.constraints.NotEmpty;
//import jakarta.validation.constraints.NotNull;
//import java.util.Arrays;
//import java.util.List;
//
///**
// * 后端 - APP用户接口
// */
//@Validated
//@RequiredArgsConstructor
//@RestController
//@RequestMapping("/user")
//public class BackendAppUserController extends BaseController {
//
//    private final IAppUserService iAppUserService;
//
//    /**
//     * 查询app用户列表
//     */
//    @SaCheckPermission("app:user:list")
//    @GetMapping("/list")
//    public TableDataInfo<AppUserVo> list(AppUserBo bo, PageQuery pageQuery) {
//        return iAppUserService.queryPageList(bo, pageQuery);
//    }
//
//    /**
//     * 导出app用户列表
//     */
//    @SaCheckPermission("app:user:export")
//    @Log(title = "app用户", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(AppUserBo bo, HttpServletResponse response) {
//        List<AppUserVo> list = iAppUserService.queryList(bo);
//        ExcelUtil.exportExcel(list, "app用户", AppUserVo.class, response);
//    }
//
//    /**
//     * 获取app用户详细信息
//     *
//     * @param id 主键
//     */
//    @SaCheckPermission("app:user:query")
//    @GetMapping("/{id}")
//    public R<AppUserVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable String id) {
//        return R.ok(iAppUserService.queryById(id));
//    }
//
//    /**
//     * 新增app用户
//     */
//    @SaCheckPermission("app:user:add")
//    @Log(title = "app用户", businessType = BusinessType.INSERT)
//    @PostMapping()
//    public R<Void> add(@Validated(AddGroup.class) @RequestBody AppUserBo bo) {
//        return toAjax(iAppUserService.insertByBo(bo));
//    }
//
//    /**
//     * 修改app用户
//     */
//    @SaCheckPermission("app:user:edit")
//    @Log(title = "app用户", businessType = BusinessType.UPDATE)
//    @PutMapping()
//    public R<Void> edit(@Validated(EditGroup.class) @RequestBody AppUserBo bo) {
//        return toAjax(iAppUserService.updateByBo(bo));
//    }
//
//    /**
//     * 删除app用户
//     *
//     * @param ids 主键串
//     */
//    @SaCheckPermission("app:user:remove")
//    @Log(title = "app用户", businessType = BusinessType.DELETE)
//    @DeleteMapping("/{ids}")
//    public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable String[] ids) {
//        return toAjax(iAppUserService.deleteWithValidByIds(Arrays.asList(ids), true));
//    }
//
//    @DeleteMapping("/deleteAccount/{id}")
//    public R<Void> deleteAccount(@NotNull @PathVariable String id) {
//        this.iAppUserService.deleteAccount(id);
//        return R.ok();
//    }
//
//}
